Repository navigation
feat: run the Gemini engine through OpenRouter - #284
Open
hyperfocus1337 wants to merge 2 commits into
Open
hyperfocus1337 wants to merge 2 commits into
hyperfocus1337 wants to merge 2 commits into
Conversation
AI Studio answers a spent prepayment balance with HTTP 402. The adapter mapped every unlisted 4xx to "rejected", whose hint blames a private, unsupported, or too-long video. 402 now maps to "quota", which points at the key's plan.
With an OPENROUTER_API_KEY and no GEMINI_API_KEY, or with WATCH_GEMINI_PROVIDER=openrouter, watch sends YouTube URLs to Gemini through OpenRouter's chat completions API with a video_url part. OpenRouter's Google AI Studio route accepts only YouTube video URLs, so other sources fail before anything is sent. OpenRouter has no clip offsets, so --start/--end become a request in the prompt, and the report says so. WATCH_GEMINI_MODEL IDs get a google/ prefix unless they contain a slash. The report shows the OpenRouter cost from the response usage.
hyperfocus1337
added a commit
to hyperfocus1337/claude-video
that referenced
this pull request
Nov 26, 2026
A distinct marketplace name lets this fork install next to the upstream claude-video marketplace. Fork-only: not part of upstream PR bradautomates#284.
hyperfocus1337
added a commit
to hyperfocus1337/coding-agent-config
that referenced
this pull request
Nov 28, 2026
… fork The fork adds an OpenRouter provider for the Gemini engine (upstream PR bradautomates/claude-video#284). The catalog row, the user-level marketplace declaration and the inventory point to hyperfocus1337/claude-video until that PR is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Gemini engine can now use an
OPENROUTER_API_KEY. YouTube URLs then go to Gemini through OpenRouter's chat completions API. The Google path does not change.--start/--endbecome a request in the prompt, and the report labels the processing asagentic, focus 00:05–00:15 requested in the prompt.WATCH_GEMINI_MODELwithout a slash gets agoogle/prefix, so the defaultgemini-3.7-flashworks for both providers.OpenRouter costfrom the responseusage.cost.Gemini quota. Before, it mapped toGemini rejectedwith a hint about private or unsupported videos. AI Studio sends 402 for a spent prepayment balance, and OpenRouter sends it for an empty balance.Evidence
Before: with only an OpenRouter key,
--engine geministops withThe gemini engine needs GEMINI_API_KEY. A spent AI Studio key reportsGemini rejected: Gemini refused this request; the video may be private, unsupported, or too long. Detail: HTTP 402: Your prepayment credits are depleted.After: a live run with an OpenRouter key:
Tests: 249 passed before, 265 passed after (
python -m pytest -q, no network). The new tests cover:Merge Danger
Door: two-way
The change adds a key and a setting, and writes no data. A revert restores the old behavior.
Blast Radius: small
GEMINI_API_KEYsee no change, becauseautoprefers it.OPENROUTER_API_KEYin the environment or in a cwd.envfor another tool, and noGEMINI_API_KEY, changes underWATCH_ENGINE=auto: YouTube URLs go from the local engine to Gemini through OpenRouter, which bills that account.WATCH_ENGINE=localorWATCH_GEMINI_PROVIDER=googlekeeps the old behavior. If you prefer, I can make OpenRouter opt-in only (WATCH_GEMINI_PROVIDER=openrouter).setup.py --jsonhas a newgemini_providerfield, and the scaffolded.envhas a newOPENROUTER_API_KEY=line. Existing config files are not rewritten.